﻿using Masa.Contrib.Service.Caller.HttpClient;
using MasaMES.Caller.Identity.Contracts;

namespace MasaMES.Caller.Identity;
public class IdentityCaller : HttpClientCallerBase
{
    protected override string BaseAddress { get; set; } = "http://masames.identity:8080";

    public IdentityCaller(IServiceProvider serviceProvider) : base(serviceProvider)
    {
    }
    public async Task<UserLoginViewDto?> Login(UserLoginDto dto)
    {
        var result = await Caller.PostAsync<IdentityResult<UserLoginViewDto>>($"/login", dto);
        return result?.Data ?? null;
    }
}
